package com.bolt.support.spring.jpa.transform;

import com.bolt.convention.data.Record;
import com.bolt.support.sqlconfig.base.SQLConfiguration;
import org.hibernate.transform.ResultTransformer;

public class ConfigSqlTransformers {

    public static ResultTransformer aliasToBean(Class returnType, SQLConfiguration configuration) {
        if (Record.class.isAssignableFrom(returnType)) {
            return RecordMapperTransform.INSTANCE;
        } else {
            return new BeanMapperTransform(returnType, configuration);
        }
    }

}